<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
/* 	function serachCheck(){
		if(document.search.keyWord.vlaue == ''){
			alert('검색어를 입력하세요');
			document.search.keyWord.focus();
			return false;
		}
	} */
</script>
</head>
<body>
<form action="list.do" name="search" method="get" onsubmit="return serachCheck()">
	<table width="200" align="center" border="0" cellspacing="0" cellpadding="2">
			<tr>
				<td align="center">
					<select name="keyField">
						<option value="userid">회원 아이디</option>
						<option value="uname">회원 이름</option>
						<option value="uphone">회원 연락처</option>
						<option value="uaddr">회원 주소</option>
						<option value="upoint">회원 포인트</option>
						<option value="all">모두</option>
					</select>
				</td>
				<td>
					<input type="text" size="16" name="keyWord">
				</td>
				<td>
					<input type="submit" value="검색">
				</td>
			</tr>
		</table><br>
		<table width="80%" border="1" cellspacing="0" cellpadding="2">
			<tr bgcolor="#F3F3F3">
				<th width="10%">번호</th>
				<th>회원 아이디</th>
				<th width="10%">회원 이름</th>
				<th width="10%">회원 연락처</th>
				<th width="40%">회원 주소</th>
				<th>회원 포인트</th>
			</tr>
			<tr bgcolor="#777777">
				<td height="1" colspan="6"></td>
			</tr>
			<c:forEach var="article" items="${list}">
				<tr>
					<td align="center" width="10%">
						${number}
						<c:set var="number" value="${number-1}"/>   
					</td>
					<td align="center">
<a href="javascript:window.open('detail.do?userid=${article.userid}','회원 상세 정보','scrollbars=no, width=550, height=550, resizable=yes, menubar=no, top=150, left=260')"> ${article.userid}</a> 
					</td>
					<td width="10%">${article.uname}</td>
					<td width="10%">${article.uphone}</td>
					<td width="40%">${article.uaddr}</td>
					<td align="center"><c:if test="${article.upoint == null}">없음</c:if><c:if test="${article.upoint > 0}">${article.upoint}</c:if></td>
				</tr>
			</c:forEach>
			<c:if test="${count == 0 }">
				<tr align="center">
					<td colspan="6">등록된 게시물이 없습니다.</td>
				</tr>
				<tr bgcolor="#777777">
					<td height="1" colspan="6"></td>
				</tr>
			</c:if>
			<tr>
				<td align="center" colspan="6">${pagingHtml}</td>
			</tr>
		</table>
</form>		
</body>
</html>